﻿using Autofac;
using DDCMS.Core.IRepository;
using DDCMS.Domain.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DDCMS.EntityFrameworkCore
{
    public class EFModule:Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }
            builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>))
                .InstancePerLifetimeScope();
            //builder.RegisterGeneric(typeof(UnitWork)).As(typeof(IUnitWork))
            //   .InstancePerLifetimeScope();
        }
    }
}
